package org.yaonan.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.yaonan.bean.YnFriend;
import org.yaonan.bean.YnUser;
import org.yaonan.dao.YnFriendMapper;
import org.yaonan.service.YnFriendService;
@Service
public class YnFriendServiceImpl implements YnFriendService {

	@Autowired
	private YnFriendMapper ynFriendMapper;
	@Override
	public List<YnUser> selectFriendsByPage(YnUser ynUser) {
		List<YnUser> list = ynFriendMapper.selectFriendsByPage(ynUser);
		return list;
	}
	@Override
	public void deleteFriend(Integer userid1, Integer userid2) {
		ynFriendMapper.deleteFriend(userid1, userid2);
		
	}
	@Override
	public List<YnUser> selectPeopleByPage(YnUser ynUser) {
		List<YnUser> list = ynFriendMapper.selectPeopleByPage(ynUser);
		return list;
	}
	@Override
	public void insertFriend(YnFriend ynFriend) {
		ynFriendMapper.insertSelective(ynFriend);
	}
	@Override
	public int selectCountFriend(Integer userid) {
		return ynFriendMapper.selectCountFriend(userid);
	}

}
